home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / RLaB 1.18c / testmatrix / symmpart.r < prev    next >
Encoding:
Text File  |  1994-05-25  |  637 b   |  23 lines  |  [TEXT/RLAB]

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:    Symmetric (Hermitian) part.
  4.  
  5. // Syntax:    S = symmpart ( A )
  6.  
  7. // Description:
  8.  
  9. //     S is the symmetric (Hermitian) part of A, (A + A')/2. It is
  10. //     the nearest symmetric (Hermitian) matrix to A in both the 2-
  11. //     and the Frobenius norms.
  12.  
  13. //    This file is a translation of symmpart.m from version 2.0 of
  14. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  15. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  16.  
  17. //-------------------------------------------------------------------//
  18.  
  19. symmpart = function ( A )
  20. {
  21.   return (A + A')./2;
  22. };
  23.